<template>
<!--  :style="{ paddingTop: `${45 + statusBarHeight}px` }" -->
  <div class="about-wrap">
    <!-- <NavBar
      :navBarStyle="{
        backgroundColor: 'none',
        height: `${45 + statusBarHeight}px`,
        paddingTop: `${statusBarHeight}px`,
      }"
      pageName="关于我们"
      :isShowBack="false"
      @onLeftClick="leftBack"
    >
      <template v-slot:nav-left>
        <img class="back-img" src="../assets/about/back.png" alt="" />
      </template>
    </NavBar>
    -->
    <div class="content">
      <div class="about-info">
        <div><img class="logo" src="@/assets/images/logo.png" alt="" /></div>
        <div class="txt">{{ version }}</div>
      </div>
      <div class="copyright">
        <a class="icp" href="https://beian.miit.gov.cn/#/home">
          <span>ICP备案号：粤ICP备2022075068号-5A</span>
          <van-icon name="arrow"></van-icon>
        </a>
      </div>
    </div>
  </div>
</template>

<script>
import { Icon } from 'vant';
export default {
  components: {
    [Icon.name]: Icon,
  },
  data() {
    return {
      version: '',
      navigationHeight: 47,
      statusBarHeight: 0,
    }
  },
  created() {
    this.getAPPNavHeight()
    this.getAppVersion()
  },
  methods: {
    leftBack() {
      console.log('back')
      if (window.androidJSBridge) {
        window.androidJSBridge.back()
      } else if (window.webkit) {
        window.webkit.messageHandlers.back.postMessage({})
      }
    },
    getAppVersion() {
      if (window.androidJSBridge) {
        const result = JSON.parse(window.androidJSBridge.appVersion())
        this.version = result.version
        console.log('android-appVersion', result)
      } else if (window.webkit) {
        window.appVersion = this.onAppVersion
        window.webkit.messageHandlers.appVersion.postMessage({})
      }
    },

    onAppVersion(result) {
      console.log('android-ios', result)
      this.version = result.version
    },

    getAPPNavHeight() {
      console.log('--appNavigation--', window)
      if (window.androidJSBridge) {
        const result = JSON.parse(window.androidJSBridge.appNavigation())
        this.navigationHeight = result.navigationHeight
        this.statusBarHeight = result.statusBarHeight
        console.log('android1', result)
      } else if (window.webkit) {
        window.appNavigation = this.onAppNavigation
        window.webkit.messageHandlers.appNavigation.postMessage({})
      }
    },

    onAppNavigation(result) {
      console.log('ios-appNavigation', result)
      this.navigationHeight = Number(result.navigationHeight)
      this.statusBarHeight = Number(result.statusBarHeight)
    },
  },
}
</script>

<style lang="less" scoped>
.about-wrap {
  width: 100%;
  height: 100vh;
  background: #fff;
  /* background: url('../assets/about/about_bg.png');
  background-size: 100% 100%; 
  background-repeat: no-repeat; */
  color: #131419;
  .back-img {
    width: 7px;
    height: 14px;
  }
  .content {
    padding-top: 95px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    .about-info {
      text-align: center;
      .logo {
        width: 100px;
        // height: 100px;
        // border-radius: 16px;
      }
      .logo-txt {
        width: 101px;
        height: px;
        margin-top: 26px;
      }
      .txt {
        font-weight: 400;
        font-size: 16px;
        padding-top: 10px;
      }
    }
    .copyright {
      color: #a9aeb4;
      font-weight: 400;
      font-size: 12px;
      text-align: center;
      padding-bottom: 50px;
      .icp {
        color: #a9aeb4;
      }
    }
  }
}
</style>
